﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SDMX_Common =  SDMX_ML.Framework.Common;
using SDMX_Message = SDMX_ML.Framework.Message;

namespace SDMX_ML.Framework.Metadata
{
    public class MetadataSetType
    {
        //Elements
        private List<SDMX_Common.TextType> _name;
        private SDMX_Common.IDType _metadataStructureAgencyRef;
        private SDMX_Common.IDType _reportRef;
        private List<AttributesValueSetType> _attributeValueSet;
        private SDMX_Common.AnnotationsType _annotations;
        private SDMX_Common.IDType _metadataStructureRef;

        //Attributes
        private string _metadataStructureURI;
        private SDMX_Common.IDType _datasetID;
        private SDMX_Common.IDType _dataProviderSchemeAgencyId;
        private SDMX_Common.IDType _dataProviderSchemeId;
        private SDMX_Common.IDType _dataProviderID;
        private SDMX_Common.IDType _dataflowAgencyID;
        private SDMX_Common.IDType _dataflowID;
        private SDMX_Common.EnumDataSetAction? _action;
        private string _reportingBeginDate;
        private string _reportingEndDate;
        private string _validFromDate;
        private string _validToDate;
        private string _publicationYear;
        private string _publicationPeriod;

        public MetadataSetType(SDMX_Common.IDType metadataStructureRef, SDMX_Common.IDType metadataStructureAgencyRef, SDMX_Common.IDType reportRef, AttributesValueSetType attributeValueSet)
        {
            if (metadataStructureRef != null & metadataStructureAgencyRef != null & reportRef != null & attributeValueSet != null)
            {
                _attributeValueSet = new List<AttributesValueSetType>();
                _name = new List<SDMX_Common.TextType>();

                _metadataStructureRef = metadataStructureRef;
                _metadataStructureAgencyRef = metadataStructureAgencyRef;
                _reportRef = reportRef;
                _attributeValueSet.Add(attributeValueSet);

            }
            else
            {
                throw new Exception("MetadataStructureRef, MetadataStructureAgencyRef, ReportRef and AttributeValueSet are required fields in MetadataSetType!");
            }
        }


        #region Properties

        /// <summary>
        /// Name.
        /// </summary>
        public List<SDMX_Common.TextType> Name
        {
            get { return _name; }
            set { _name = value; }
        }
  
        /// <summary>
        /// MetadataStructureRef.
        /// </summary>
        public SDMX_Common.IDType MetadataStructureRef
        {
            get { return _metadataStructureRef; }
            set { _metadataStructureRef = value; }
        }
        
        /// <summary>
        /// MetadataStructureAgencyRef.
        /// </summary>
        public SDMX_Common.IDType MetadataStructureAgencyRef
        {
            get { return _metadataStructureAgencyRef; }
            set { _metadataStructureAgencyRef = value; }
        }
        
        /// <summary>
        /// ReportRef.
        /// </summary>
        public SDMX_Common.IDType ReportRef
        {
            get { return _reportRef; }
            set { _reportRef = value; }
        }
        
        /// <summary>
        /// AttributeValueSet.
        /// </summary>
        public List<AttributesValueSetType> AttributeValueSet
        {
            get { return _attributeValueSet; }
            set { _attributeValueSet = value; }
        }
        
        /// <summary>
        /// Annotations.
        /// </summary>
        public SDMX_Common.AnnotationsType Annotations
        {
            get { return _annotations; }
            set { _annotations = value; }
        }

        /// <summary>
        /// MetadataStructureURI.
        /// </summary>
        public string MetadataStructureURI
        {
            get { return _metadataStructureURI; }
            set { _metadataStructureURI = value; }
        }

        /// <summary>
        /// DatasetID.
        /// </summary>
        public SDMX_Common.IDType DatasetID
        {
            get { return _datasetID; }
            set { _datasetID = value; }
        }

        /// <summary>
        /// DataProviderSchemeAgencyId.
        /// </summary>
        public SDMX_Common.IDType DataProviderSchemeAgencyId
        {
            get { return _dataProviderSchemeAgencyId; }
            set { _dataProviderSchemeAgencyId = value; }
        }

        /// <summary>
        /// DataProviderSchemeId.
        /// </summary>
        public SDMX_Common.IDType DataProviderSchemeId
        {
            get { return _dataProviderSchemeId; }
            set { _dataProviderSchemeId = value; }
        }

        /// <summary>
        /// DataProviderID.
        /// </summary>
        public SDMX_Common.IDType DataProviderID
        {
            get { return _dataProviderID; }
            set { _dataProviderID = value; }
        }

        /// <summary>
        /// DataflowAgencyID.
        /// </summary>
        public SDMX_Common.IDType DataflowAgencyID
        {
            get { return _dataflowAgencyID; }
            set { _dataflowAgencyID = value; }
        }

        /// <summary>
        /// DataflowID.
        /// </summary>
        public SDMX_Common.IDType DataflowID
        {
            get { return _dataflowID; }
            set { _dataflowID = value; }
        }

        /// <summary>
        /// Action.
        /// </summary>
        public SDMX_Common.EnumDataSetAction? Action
        {
            get { return _action; }
            set { _action = value; }
        }

        /// <summary>
        /// ReportingBeginDate.
        /// </summary>
        public string ReportingBeginDate
        {
            get { return _reportingBeginDate; }
            set { _reportingBeginDate = value; }
        }

        /// <summary>
        /// ReportingEndDate.
        /// </summary>
        public string ReportingEndDate
        {
            get { return _reportingEndDate; }
            set { _reportingEndDate = value; }
        }

        /// <summary>
        /// ValidFromDate.
        /// </summary>
        public string ValidFromDate
        {
            get { return _validFromDate; }
            set { _validFromDate = value; }
        }

        /// <summary>
        /// ValidToDate.
        /// </summary>
        public string ValidToDate
        {
            get { return _validToDate; }
            set { _validToDate = value; }
        }

        /// <summary>
        /// PublicationYear.
        /// </summary>
        public string PublicationYear
        {
            get { return _publicationYear; }
            set { _publicationYear = value; }
        }

        /// <summary>
        /// PublicationPeriod.
        /// </summary>
        public string PublicationPeriod
        {
            get { return _publicationPeriod; }
            set { _publicationPeriod = value; }
        }

        #endregion

        



    }
}
